import {
  Table,
} from 'choerodon-ui/pro';
import React, { useContext, ReactElement, MouseEventHandler } from 'react';
import {
  TableEditMode,
  TableButtonType,
} from 'choerodon-ui/pro/lib/table/enum';
import { ButtonProps } from 'choerodon-ui/pro/lib/button/Button';
import { ColumnProps } from 'choerodon-ui/pro/lib/table/Column';
import Store from './stores';

export declare type TableButtonProps = ButtonProps & {
  afterClick?: MouseEventHandler<any>;
};
export declare type Buttons = TableButtonType | [TableButtonType, TableButtonProps] | ReactElement<TableButtonProps>;
const From: React.FC = (): React.ReactElement => {

  const { tableProgressDataSet } = useContext(Store);


  const columns: ColumnProps[] = [
    { name: 'time', width: 150, sortable: true },
    { name: 'rate', width: 150, sortable: true },
    { name: 'status', width: 150, sortable: true },
    { name: 'operator', width: 150, sortable: true },
    { name: 'cost', width: 150, sortable: true },
  ];

  return (
    <Table
      header="退货进度"
      dataSet={tableProgressDataSet!}
      columns={columns}
      editMode={TableEditMode.inline} // 行内编辑
      pagination={false}
    />
  );
};

export default From;